<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
$('#tt').tabs({
    border:false,
    onSelect:function(title){
		alert(title+' is selected');
    }
});

function tables(tkds){
 	$('#tkds_jieguo').datagrid({    
 		//数据源地址
 		url:'tikudanshunchaxun',
 		queryParams:{
 			tmsub:tkds
 		},
	    columns:[[
	    	{field:'TMZID',fixed:false,width:180,title:'题目编号',hidden:true,align:'center'},
	    	{field:'QSBBANK',fixed:false,width:180,title:'题库名',align:'center'},
	    	{field:'tm',fixed:false,width:300,title:'题目',align:'center'},
	    	{field:'DA1',fixed:false,width:180,title:'选项A',align:'center'},
	    	{field:'DA2',fixed:false,width:180,title:'选项B',align:'center'},    
	        {field:'DA3',fixed:false,width:180,title:'选项C',align:'center'},    
	        {field:'DA4',fixed:false,width:180,title:'选项D',align:'center'},
	        {field:'TMNYD',fixed:false,width:180,title:'难易度',align:'center'},
	        {field:'TMZSD',fixed:false,width:180,title:'知识点',align:'center'},
	        {field:'TMFS',fixed:false,width:180,title:'分值',align:'center'},
	        {field:'TMBDA',fixed:false,width:180,title:'答案',align:'center'} 
	       
	    ]],
	    pagination:true,
	    pageNumber:1,
	    pageSize:5,
	    pageList:[5,10,15]      
	});
 	
}

/* //在每个操作列里面添加编辑，查看，明细，删除
function operate_formatter(value, row, index) {
  return "<button  class='tkds_caozuoshanchu' onclick='deleteSJ("+row.TMZID+")'>删除</button>";
} 

//删除方法
function deleteSJ(TMZID){
	alert(TMZID);
	deleteBG("deleteDX","tkds_jieguo",{"tmzid":TMZID});
} */
function tikudanshunsousuo(value,name){
    tables(value);
}
function tablessss(QSB){
	  $('#tkds_jieguo').datagrid({    
	 		//数据源地址
	 		url:'dstikuxiala',
	 		queryParams:{
	 			QSB:QSB
	 		},
		    columns:[[
		    	{field:'TMZID',fixed:false,width:180,title:'题目编号',hidden:true,align:'center'},
		    	{field:'QSBBANK',fixed:false,width:180,title:'题库名',align:'center'},
		    	{field:'tm',fixed:false,width:300,title:'题目',align:'center'},
		    	{field:'DA1',fixed:false,width:180,title:'选项A',align:'center'},
		    	{field:'DA2',fixed:false,width:180,title:'选项B',align:'center'},    
		        {field:'DA3',fixed:false,width:180,title:'选项C',align:'center'},    
		        {field:'DA4',fixed:false,width:180,title:'选项D',align:'center'},
		        {field:'TMNYD',fixed:false,width:180,title:'难易度',align:'center'},
		        {field:'TMZSD',fixed:false,width:180,title:'知识点',align:'center'},
		        {field:'TMFS',fixed:false,width:180,title:'分值',align:'center'},
		        {field:'TMBDA',fixed:false,width:180,title:'答案',align:'center'} 
		       
		    ]],
		    pagination:true,
		    pageNumber:1,
		    pageSize:5,
		    pageList:[5,10,15]      
		});
}
$(function(){
	//显示
	 $('#Tiku2').combobox({
		 url:'tiku',
		 valueField:'QSBID',
		 textField:'QSBBANK',
		 onChange:function(){
			  var Tiku2 = $("#Tiku2").combobox("getText");
			  tablessss(Tiku2);
		   }
	 });
	
	 $('#Zhishizu2').combobox({
		 url:'zhishidian',
		 valueField:'TMZID',
		 textField:'tmzsd',
			 onChange:function(){
				 var Zhishizu2 = $("#Zhishizu2").combobox("getText");
				 tablessss(Zhishizu2);
			   }
	 });
	 
	 $('#Nanyidu2').combobox({
		 url:'nanyidu',
		 valueField:'TMZID',
		 textField:'tmnyd',
		  onChange:function(){
			  var Nanyidu2 = $("#Nanyidu2").combobox("getText");
			  tablessss(Nanyidu2);
		   }
	 });
	 
 tables(null);
 
	$(".pxkjpf_xianshi").click(function(){
		tables();
	})
 	
})	 
 	$(function(){
 		$("#tkds_jieguo").datagrid({
 	        //双击事件
 	        onDblClickRow: function (index,row) {
 	        	$("#tk_danshunxiangqing").window("open"); 
 	        	$("#timuid").val(row["TMZID"]);
 	        	$("#ds_xxa").val(row["DA1"]);
 	        	$("#ds_xxb").val(row["DA2"]);
 	        	$("#ds_xxc").val(row["DA3"]);
 	        	$("#ds_xxd").val(row["DA4"]);
 	        	$("#ds_daan").val(row["TMBDA"]);
 	        	$("#ds_timu").val(row["tm"]);
 	        	
 	              
 	        }
 	    });
 		
 		$(".tkds_xiugai").click(function(){   
 			  var tmid=$("#timuid").val();
 	          var xxa=$("#ds_xxa").val();
 	          var xxb=$("#ds_xxb").val();
 	          var xxc=$("#ds_xxc").val();
 	          var xxd=$("#ds_xxd").val();
 	          var daan=$("#ds_daan").val();
 	          var timu=$("#ds_timu").val();
 		   $.ajax({
 				url:"xztxiugai",
 				type:"post",
 				data:{
 					tmid:tmid,
 					xxa:xxa,
 					xxb:xxb,
 					xxc:xxc,
 					xxd:xxd,
 					daan:daan,
 					timu:timu,
 				},
 				success:function(data){
 				$("#tk_danshunxiangqing").window("close");
 				$( '#tkds_jieguo').datagrid('reload');
 			}
 		  })
 		})
 		
 		$(".tkds_xinzeng").click(function(){
 			var text='新增选择试题';
 			var url="tyl/tk-dan-shun-xin-zeng";
 			add(text,url)
 		
 		
 	});
})



</script>
			
			   <div id="tk_danshunxiangqing" class="easyui-window" title="考题详情" style="width:690px;height:375px"
		    		data-options="closed:true,minimizable:false,maximizable:false,collapsible:false,modal:true">
		    		             <div class="danshunxiangqing_one">
		    		                   <div class="tkds_xunxianga">选项A:<input class="tkds_tiqukuang" type="text" id="ds_xxa"></div>
		    		                   <div class="tkds_xunxiangb">选项B:<input class="tkds_tiqukuang" type="text" id="ds_xxb"></div>
		    		             </div>
		    		             <div class="danshunxiangqing_two">
		    		                   <div class="tkds_xunxiangc">选项C:<input class="tkds_tiqukuang" type="text" id="ds_xxc"></div>
		    		                   <div class="tkds_xunxiangd">选项D:<input class="tkds_tiqukuang" type="text" id="ds_xxd"></div>
		    		             </div>
		    		             <div class="danshunxiangqing_three">
		    		                   <div class="tkds_daan">答案：<input class="tkds_tiqukuang" type="text" id="ds_daan"></div>
		    		                   <div class="tkds_timus">题目：<input class="tkds_tiqukuang" type="text" id="ds_timu"></div>
		    		             </div>
		    		             <div class="danshunxiangqing_four">
		    		                   <div class="tkds_xiugai"><button class="tkds_gai">修改</button></div>
		    		             </div>
		    		</div>
			    	   
				<div class="tikudanshun_zong">
				
				    <div class="tikudanshun_shang">
				              <div class="tkds_xianshi">
				              <button class="tkds_xinzeng">题目新增</button>
				                   <div class="ds_nanyidu">难易度：
				                  		<input type="hidden" id="timuid">
				                  	    <input id="Nanyidu2" class="easyui-combobox nanyidushuru">
                    
		    		                </div>
		    		                <div class="ds_zhishizu">知识组：
                                       <input id="Zhishizu2" class="easyui-combobox zhishizushuru">
		    		                </div>
		    		                  <div class="ds_tiku">题库：
                                        <input id="Tiku2" class="easyui-combobox tikeshuru">
		    		                </div>
				              </div>
				           
				              <div class="tkds_shanchu">
				                  <input id="ss" class="easyui-searchbox" style="width:300px" data-options="searcher:tikudanshunsousuo,prompt:'查询'"></input>			
				                  
				              </div>
				    </div>
				    <div class="tikudanshun_xia">
				             <table id="tkds_jieguo" class="easyui-datagrid" style="width:100%;height:350px;margin-top:20px;" data-options="fitColumns:true">
                                   
                            </table>
				    </div>
				</div>
</body>
</html>